{extend name="layout" /}
{block name="body"}
<main role="main" class="flex-shrink-0">
  <div class="container py-3">
    
    <div class="row">
      <!-- 文章列表 -->
      <div class="col-xl-8">
        {volist name="list" id="vo"}
        <article class="lyear-list-arc">
          <div class="arc-header">
            <h5 class="arc-title"><a href="{:url('/article/'.$vo['id'])}">{$vo.title}</a></h5>
            <ul class="arc-meta">
              {php}
              if (!empty($vo['column_route_name'])) {
                  $column_url = url('/article/'.$vo['column_route_name']);
              } else {
                  $column_url = url('/article/list_'.$vo['cid']);
              }
              {/php}
              <li><i class="mdi mdi-calendar"></i> <a href="{$column_url}" target="_blank">{$vo.column_title}</a></li>
              <li><i class="mdi mdi-calendar"></i> {$vo.create_time}</li>
              {php}
              $tags_arr = explode(',', $vo['tags']);
              $tags_count = count($tags_arr);
              {/php}
              {notempty name="$vo['tags']"}
              <li>
                <i class="mdi mdi-tag-text-outline"></i> 
                {volist name="tags_arr" id="tag" key="k"}
                <a href="/tag/{$tag}">{$tag}</a>{if condition="$tags_count == $k"}{else/},{/if} 
                {/volist}
              </li>
              {/notempty}
              <li><i class="mdi mdi-eye"></i> {$vo.clicks} 阅读</li>
            </ul>
          </div>
  
          {notempty name="vo['cover']"}
          <div class="arc-preview">
            <img src="{$vo.cover|get_file_path}" alt="{$vo.title}" class="img-fluid rounded" />
          </div>
          {/notempty}

          <div class="arc-synopsis">
            <p>{$vo.description}</p>
          </div>
        </article>
        {/volist}
  
        <!-- 分页 -->
        <div class="row">
          <div class="col-lg-12">
            {$list|raw}
          </div>
        </div>
        <!-- 分页 end -->
      </div>
      <!-- 内容 end -->
  
      <!-- 侧边栏 -->
      <div class="col-xl-4">
        <div class="lyear-sidebar">
          
          <!-- 热门文章 -->
          <aside class="widget widget-hot-posts">
            <div class="widget-title">热门文章</div>
            <ul>
              {volist name="hot_arc" id="arc"}
              <li>
                <a href="{:url('/article/'.$arc['id'])}">{$arc.title}</a> <span>{$arc.create_time}</span>
              </li>
              {/volist}
            </ul>
          </aside>
  
        </div>
      </div>
      <!-- 侧边栏 end -->
    </div>
  
  </div>
</main>
{/block}